import http from "@/config/config"

const  LoginApi ={

   //获取验证码
   getCheckCode:()=>{
     return http.get('/checkcode').then(res=>{
        return res.data;
     })
   },
   //登录
   login:(loginUser:any)=>{
     return http.post('/login',
     {
        "username":loginUser.username,
        "password":loginUser.password,
        "code":loginUser.code
     }).then(res=>{
    
        return res.data;
     })
   },
   //退出登录
   logout:(username:any)=>{
      return http.get('/logout?username='+username).then(res=>{
         return res.data
      })
   }
}


export default LoginApi;